class Animal {
    String name;
    int age;

    Animal (String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println(name + "正在吃饭");
    }
}
class Dog extends Animal {
    Dog(String name,int age) {
        super(name,age);
    }
    public void eat() {
        System.out.println(name + "吃骨头");
    }
}
class Cat extends Animal {
    Cat(String name, int age) {
        super(name,age);
    }
    public void eat() {
        System.out.println(name + "吃鱼干");
    }
}
public class Test {
    public static void eat(Animal a) {
        a.eat();
    }
    public static void main(String[] args) {
        Dog dog1 = new Dog("小七", 1);
        Cat cat1 = new Cat("元宝",1);

        eat(dog1);
        eat(cat1);

    }
}
